<h1>Reservas</h1>

<table>
  <tr>
    <th>Usuario</th>
    <th>Sala</th>
    <th>Materia</th>
  </tr>

<% @reservas.each do |reserva| %>
  <tr>
    <td><%=h reserva.usuario.nome %></td>
    <td><%=h reserva.sala.nome %></td>
    <td><%=h reserva.materia.nome %></td>
    <td><%= link_to 'Cadastrar/lista horarios e data',:action => "cadastrarhorariodata", :id => reserva  %></td>
    <td><%= link_to 'Editar', edit_reserva_path(reserva) %></td>
    <td><%= link_to 'Excluir', reserva, :confirm => 'Confirmar Exclusão?', :method => :delete %></td>
  </tr>
<% end %>
</table>

<br />

<a href='<%=new_reserva_path %>'><button type="button">Nova reserva</button></a>
<a href='main'><button type="button">Voltar</button></a>
